﻿using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;

namespace Modules.Entitys
{
    /// <summary>
    /// 工人通知
    ///</summary>
    [TableName("worker_notify")]
    [Description("工人通知")]
    [PrimaryKey("id", AutoIncrement = false)]
    [CacheSetting(true)]
    [Serializable]
    public class WorkerNotify : IEntity
    {
        /// <summary>
        /// 工人通知主键Id
        ///</summary>
        [Column("id")]
        public string Id { get; set; }

        /// <summary>
        /// 项目Id
        /// </summary>
        [Column("project_id")]
        public int ProjectId { get; set; }

        /// <summary>
        /// 通知标题
        ///</summary>
        [Column("title")]
        public string Title { get; set; }

        /// <summary>
        /// 通知内容
        ///</summary>
        [Column("content")]
        public string Content { get; set; }

        /// <summary>
        /// 已读次数
        ///</summary>
        [Column("readed_num")]
        public int ReadedNum { get; set; } = 0;

        /// <summary>
        /// 发布者
        ///</summary>
        [Column("creator")]
        public string Creator { get; set; } = string.Empty;

        /// <summary>
        /// 发布时间
        ///</summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 修改时间
        ///</summary>
        [Column("update_time")]
        public DateTime UpdateTime { get; set; } = DateTime.Now;

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return this.Id; } }

        #endregion IEntity 成员
    }
}